1. Field of the Invention
This invention relates in general to data storage systems, and more particularly to a method and apparatus for increasing RAID (redundant array of independent disks) write performance by maintaining a full track write counter.
2. Description of Related Art
In recent years, there has been a growth in interest in disk arrays. Disk arrays consist of a number of disk drives connected to a host system via one or more controller elements which control the transfer of data between the host and disk drives. A disk array is designed to provide high capacity data storage, high reliability and high data transfer rates to and from the system.
RAID was conceived at the University California at Berkeley in 1987 as a means for improving storage subsystem reliability and performance. The concept initially consisted of clustering small inexpensive disk drives into an array such that the array could appear to the system as a single large expensive drive (SLED). The result of this initial testing found that the array of drives could actually deliver the same or better performance than the traditional individual hard drive. However, there was a problem with this implementation. The resulting Mean Time Before Failure (MTBF) of the array was actually reduced due to the probability of any one drive of the array failing. As a result of this finding, the Berkeley scientists proposed five levels or methods of RAID to provide a balance of performance and data protection. RAID subsystems can be optimized for performance, the highest capacity, fault tolerance or a combination of two or three of the above. Different so-called RAID levels have been defined and standardized in accordance with those general optimization parameters. There are six standardized RAID levels, called RAID 0, 1, 2, 3, 4 or 5.
A RAID controller board is the hardware element that serves as the backbone for the array of disks. It not only relays the input/output (I/O) commands to specific drives in the array, but provides the physical link to each of the independent drives so they may easily be removed or replaced. The controller also serves to monitor the integrity of each drive in the array to anticipate the need to move data should it be placed in jeopardy by faulty or failing disk drive (a feature known as xe2x80x9cfault tolerancexe2x80x9d). RAID utilizes some form of parity information to maintain data integrity across all drives in the subsystem. A rank is the set of logical volumes related to each other for parity protection, i.e., the number or set of drives covered by a parity scheme.
RAID Level 0 is achieved through a method known as striping and is optimized for performance at the expense of fault tolerance. Disk striping is a technique for spreading data over multiple disk drives. Disk striping can speed up operations that retrieve data from disk storage. The computer system breaks a body of data unto units and spreads these units across the available disks. Systems that implement disk striping generally allow the user to select the data unit size or stripe width.
The collection of drives in a RAID Level 0 array has data laid down in such a way that it is organized in stripes across the multiple drives. A typical array can contain any number of stripes, usually in multiples of the number of drives present in the array.
The reason RAID 0 is a performance-enhancing configuration is that striping enables the array to access data from multiple drives at the same time. In other words, since the data is spread out across a number of drives in the array, it can be accessed faster because it""s not bottled up on a single drive. This is especially beneficial for retrieving very large files, since they can be spread out effectively across multiple drives and accessed as if it were the size of any of the fragments it is organized into on the data stripes.
The downside to RAID Level 0 configurations is that it sacrifices fault tolerance, raising the risk of data loss because no room is made available to store redundant data. If one of the drives in the RAID 0 fails for any reason, there is no way of retrieving the lost data as can be done in other RAID implementations described below.
The RAID Level 1 is achieved through disk mirroring, and is done to ensure data reliability or a high degree of fault tolerance. RAID 1 also enhances read performance, but the improved performance and fault tolerance are at the expense of available capacity in the drives used.
In a RAID Level 1 configuration, the RAID management software instructs the subsystem""s controller to store data redundantly across a number of the drives (mirrored set) in the array. In other words, the same data is copied and stored on different disks (or xe2x80x9cmirroredxe2x80x9d) to ensure that, should a drive fail, the data is available somewhere else within the array. In fact, all but one of the drives in a mirrored set could fail and the data stored to the RAID 1 subsystem would remain intact. A RAID Level 1 configuration can consist of multiple mirrored sets, whereby each mirrored set can be a different capacity. Usually the drives making up a mirrored set are of the same capacity. If drives within a mirrored set are of different capacities, the capacity of a mirrored set within the RAID 1 subsystem is limited to the capacity of the smallest-capacity drive in the set.
The read performance gain can be realized if the redundant data is distributed evenly on all of the drives of a mirrored set within the subsystem. The number of read requests and total wait state times both drop significantly; inversely proportional to the number of hard drives in the RAID.
RAID Level 2 is rarely used in commercial applications, but is another means of ensuring data is protected in the event drives in the subsystem incur problems or otherwise fail. This level builds fault tolerance around Hamming error correction code (ECC), which is used as a means of maintaining data integrity. ECC tabulates the numerical values of data stored on specific blocks in the virtual drive using a special formula that yields what is known as a checksum. The checksum is then appended to the end of the data block for verification of data integrity when needed.
As data gets read back from the drive, ECC tabulations are again computed, and specific data block checksums are read and compared against the most recent tabulations. If the numbers match, the data is intact; if there is a discrepancy, the lost data can be recalculated using the first or earlier checksum as a reference point.
RAID level 3 is really an adaptation of RAID Level 0 that sacrifices some capacity, for the same number of drives, but achieves a high level of data integrity or fault tolerance. It takes advantage of RAID Level 0""s data striping methods, except that data is striped across all but one of the drives in the array. This drive is used to store parity information that is used to maintain data integrity across all drives in the subsystem. The parity drive itself is divided up into stripes, and each parity drive stripe is used to store parity information for the corresponding data stripes dispersed throughout the array. This method achieves very high data transfer performance by reading from or writing to all of the drives in parallel or simultaneously but retains the means to reconstruct data if a given drive fails, maintaining data integrity for the system. RAID Level 3 is an excellent configuration for moving very large sequential files in a timely manner.
The stripes of parity information stored on the dedicated drive are calculated using an xe2x80x9cExclusive ORxe2x80x9d function, which is a logical function between the two series that carries most of the same attributes as the conventional OR function. The difference occurs when the two bits in the function are both non-zero: in Exclusive OR, the result of the function is zero, wherein with conventional OR it would be one.
RAID Level 4 is similar in concept to RAID Level 3, but emphasizes performance for different applications. Another difference between the two is that RAID Level 4 has a larger stripe depth, usually of two blocks, which allows the RAID management software to operate the disks much more independently than RAID Level 3. This essentially replaces the high data throughput capability of RAID Level 3 with faster data access in read-intensive applications.
A shortcoming of RAID level 4 is rooted in an inherent bottleneck on the parity drive. As data gets written to the array, the parity encoding scheme tends to be more tedious in write activities than with other RAID topologies. This more or less relegates RAID Level 4 to read-intensive applications with little need for similar write performance. As a consequence, like its Level 3, it doesn""t see much common use in commercial applications.
Finally, RAID Level 5 is the last of the most common RAID levels in use, and is probably the most frequently implemented. RAID Level 5 minimizes the write bottlenecks of RAID Level 4 by distributing parity stripes over a series of hard drives. In doing so it provides relief to the concentration of write activity on a single drive, which in turn enhances overall system performance.
The way RAID Level 5 reduces parity write bottlenecks is relatively simple. Instead of allowing any one drive in the array to assume the risk of a bottleneck, all of the drives in the array assume write activity responsibilities. The distribution frees up the concentration on a single drive, improving overall subsystem throughput.
RAID Level 5""s parity encoding scheme is the same as Levels 3 and 4; it maintains the system""s ability to recover any lost data should a single drive fail. This can happen as long as no parity stripe on an individual drive stores the information of a data stripe on the same drive. In other words, the parity information for any data stripe must always be located on a drive other than the one on which the data resides.
RAID strategies can be implemented using hardware or software solutions. In a hardware solution, the RAID controller interface handles the creation and regeneration of redundant information. Some vendors sell disk subsystems that implement RAID technology completely within the hardware. Some of these hardware implementations support hot-swapping of disks, which enables you to replace a failed disk while the computer is still running. A hardware implementation of RAID support can offer performance advantages over the software implementation included in Windows NT(copyright).
Windows NT provides a software implementation for RAID using the Windows NT file system (NTFS) and the File Allocation Table (FAT) file system. Windows NT Server provides software support for two fault-tolerant disk configurations: mirror sets and stripe sets with parity. Windows NT Server and Windows NT Workstation have software support for stripe sets.
Still, computer system performance is determined by a combination of factors working in tandem to achieve the efficient results people have come to expect from even basic computer systems. In the early stages of the buying cycle, processor speeds typically get the most attention, but they are actually only one consideration in overall system performance. In addition to determining processor speed and hard drive size requirements, understanding the complexities of RAM (random access memory) is critical. RAM is the component that handles the executable tasks of any application. When an application is recalled from the hard drive, the program is put into the RAM and is ready to be used. The amount of RAM in a system has a large effect on the speed in which it will run an application. The more RAM available, the less the processor has to access the hard drive, because more instructions can be carried out by the main memory instead of temporarily holding them in the hard drive. Thus, system performance is increased. In fact, in some configurations, a system with more RAM will run faster than the same system with a faster processor but with less RAM.
However, when performing a RAID write, the RAID write may not contain a stripe width of full tracks. To perform the write, the parity must first be read, then the new parity generated, and finally the data and new parity can be written. To optimize this process, the parity read can be avoided by writing a stripe width of full tracks. During a write, an assumption that a stripe of full tracks exist must be made and then the tracks are grouped. Nevertheless, during the grouping, the controller may discover that a stripe of full tracks does not exist, yet the write will still include a parity read and the overhead doing the track grouping has been incurred.
It can be seen then that there is a need for a method and apparatus for avoiding unnecessary track grouping during writes.
It can also be seen that there is a need for a method and apparatus to indicate whether or not the track grouping will result in a stripe width of full tracks which can be written in a group to avoid the parity read.
To overcome the limitations in the prior art described above, and to overcome other limitations that will become apparent upon reading and understanding the present specification, the present invention discloses a method and apparatus for improving write performance in a disk array.
The present invention solves the above-described problems by providing a method and apparatus for avoiding unnecessary track grouping during writes by using a full track write counter. For the purpose of this invention, a write complete using the entire image in cache will herein be referred to as a full track write.
A method in accordance with the principles of the present invention includes receiving a write request, analyzing a full track write counter for tracks in a stripe of tracks associated with the write request, determining whether write request involves a full track write and subsequently executing a cache destage based on the analysis of the full track write counter for tracks in a stripe of tracks associated with the write request.
Other embodiments of a method in accordance with the principles of the invention may include alternative or optional additional aspects. One such aspect of the present invention is that the full track write counter is not incremented when the write to cache is not a full track write.
Another embodiment of the present invention is that a previous track full track count is fetched, a full track count of the tracks associated with the write request are set to be equal to the minimum of either the stripe width or the previous track""s full track count plus 1 and the write to the cache is a full track write.
Another embodiment of the present invention is that the step of analyzing a full track write counter further includes receiving a de-stage request for a track and determining whether the full track write counter of the last track in the stripe is equal to a stripe width.
Another embodiment of the present invention is that each track in the stripe is processed for de-stage, new parity for the stripe is generated based on modifications to each track and new data resulting from the modifications and the new parity are written to a rank when the full track write counter of the last track in the stripe is equal to the stripe width.
Another aspect of the present invention is that the generation of new parity comprises exclusively ORing the striped data when the full track write counter of the last track in the stripe is equal to the stripe width.
Another aspect of the present invention is that only the track associated with the de-stage request is processed, an old parity and old data for the track associated with the de-stage request, new parity is generated and new data resulting from a modification to the track and the new parity are written to a rank when the full track write counter of the last track in the stripe is not equal to the stripe width.
Another aspect of the present invention is that the generation of new parity comprises exclusively ORing the old data, the new data and old parity associated with the stripe when the full track write counter of the last track in the stripe is not equal to the stripe width.
These and various other advantages and features of novelty which characterize the invention are pointed out with particularity in the claims annexed hereto and form a part hereof. However, for a better understanding of the invention, its advantages, and the objects obtained by its use, reference should be made to the drawings which form a further part hereof, and to accompanying descriptive matter, in which there are illustrated and described specific examples of an apparatus in accordance with the invention.